package gemini.castor.ui.client.page.content.office.recognitions.form;

import gemini.castor.ui.client.constants.I18nConstants;
import gemini.castor.ui.client.page.widget.promotion.PromotionWidget;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiTemplate;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class RecognitionsFormView extends Composite implements
		RecognitionsFormPresenter.Display {

	@UiTemplate("RecognitionsFormView.ui.xml")
	interface MyUiBinder extends UiBinder<Panel, RecognitionsFormView> {
	}

	private static final MyUiBinder binder = GWT.create(MyUiBinder.class);
	private I18nConstants constants;

	public RecognitionsFormView() {
		initWidget(binder.createAndBindUi(this));
		constants = GWT.create(I18nConstants.class);
	}

	@UiField
	VerticalPanel vplBiographies;

	@UiField
	VerticalPanel vplMarketing;

	@Override
	public Widget asWidget() {
		return this;
	}

	@Override
	public void loadData() {
		//TODO: Load data for vplBiographies
		vplBiographies.clear();
		PromotionWidget pwg1 = new PromotionWidget();
		pwg1.loadData(
				"images/logo/herbalife_98x98.jpg",
				constants.htmBiographiesName1(),
				constants.htmBiographiesDetail1()
						+ "<br/><a href=\"documents/2011_ActiveWorldTeam_usen.pdf\">"
						+ constants.htmDownloadDoc() + "</a>");
		vplBiographies.add(pwg1);

		PromotionWidget pwg2 = new PromotionWidget();
		pwg2.loadData(
				"images/logo/presteam_icon_98x98.gif",
				constants.htmBiographiesName2(),
				constants.htmBiographiesDetail2()
						+ "<br/><a href=\"documents/2011_ActiveWorldTeam_usen.pdf\">"
						+ constants.htmDownloadDoc() + "</a>");
		vplBiographies.add(pwg2);

		//TODO: Load data for vplMarketing
		vplMarketing.clear();
		PromotionWidget pwg11 = new PromotionWidget();
		pwg11.loadData(
				"images/logo/herbalife_98x98.jpg",
				constants.htmMarketingName1(),
				constants.htmMarketingDetail1()
						+ "<br/><a href=\"documents/2011_ActiveWorldTeam_usen.pdf\">"
						+ constants.htmDownloadDoc() + "</a>");
		vplMarketing.add(pwg11);

		PromotionWidget pwg12 = new PromotionWidget();
		pwg12.loadData(
				"images/logo/get_icon_98x98.gif",
				constants.htmMarketingName2(),
				constants.htmMarketingDetail2()
						+ "<br/><a href=\"documents/2011_ActiveWorldTeam_usen.pdf\">"
						+ constants.htmDownloadDoc() + "</a>");
		vplMarketing.add(pwg12);

		PromotionWidget pwg13 = new PromotionWidget();
		pwg13.loadData(
				"images/logo/presteam_icon_98x98.gif",
				constants.htmMarketingName3(),
				constants.htmMarketingDetail3()
						+ "<br/><a href=\"documents/2011_ActiveWorldTeam_usen.pdf\">"
						+ constants.htmDownloadDoc() + "</a>");
		vplMarketing.add(pwg13);
		
		PromotionWidget pwg14 = new PromotionWidget();
		pwg14.loadData(
				"images/logo/worldteam_icon_98x98.gif",
				constants.htmMarketingName4(),
				constants.htmMarketingDetail4()
						+ "<br/><a href=\"documents/2011_ActiveWorldTeam_usen.pdf\">"
						+ constants.htmDownloadDoc() + "</a>");
		vplMarketing.add(pwg14);
		
		PromotionWidget pwg15 = new PromotionWidget();
		pwg15.loadData(
				"images/logo/millteam_icon_98x98.gif",
				constants.htmMarketingName5(),
				constants.htmMarketingDetail5()
				+ "<br/><a href=\"documents/2011_ActiveWorldTeam_usen.pdf\">"
				+ constants.htmDownloadDoc() + "</a>");
		vplMarketing.add(pwg15);
	}
}
